package com.gof.example.chain;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/9 21:20.
 * haiming.fei@tongdun.cn
 */
public class App {

    public static void main(String[] args) {
        Approver d = new Director();
        d.setFullName("杨平");

        Approver m = new Manager();
        m.setFullName("司马懿");

        Approver p = new President();
        p.setFullName("司马防");

//        Approver u = new Unknown();
//        u.setFullName("未知");

        d.setApprover(m);
        m.setApprover(p);

        d.requestHandler(new Offwork(new Date(), 2));
        d.requestHandler(new Offwork(new Date(), 5));
        d.requestHandler(new Offwork(new Date(), 21));
        d.requestHandler(new Offwork(new Date(), 102));
    }
}
